package com.tools;

import java.util.Calendar;
import java.util.Date;

public class ShiJian {
	private static Calendar  shijian;
	
	public static String getNian()
	{		
		shijian = Calendar.getInstance();
		return shijian.get(Calendar.YEAR)+"";		
	}
	
	public static String getYue()
	{				
		int str=shijian.get(Calendar.MONTH)+1;
		if(str<10)
			return "0"+str;		
		else
			return str+"";
	}
	
	public static String getRi()
	{		
		int str=shijian.get(Calendar.DATE);
		if(str<10)
			return "0"+str;		
		else
			return str+"";
	}
	
	public static String getShi()
	{		
		int str=shijian.get(Calendar.HOUR_OF_DAY);
		if(str<10)
			return "0"+str;		
		else
			return str+"";
	}
	
	public static String getFen()
	{			
		int str=shijian.get(Calendar.MINUTE);
		if(str<10)
			return "0"+str;		
		else
			return str+"";
	}
	
	public static String getMiao()
	{				
		int str=shijian.get(Calendar.SECOND);
		if(str<10)
			return "0"+str;		
		else
			return str+"";
	}
}
